<template>
  <div style="margin: 5px">
    <el-dropdown class="avatar-container">
      <div class="avatar-wrapper" style="display: flex; align-items: center">
        <svg-icon style="color: #fff; font-size: 20px" icon-class="language" />
      </div>
      <el-dropdown-menu slot="dropdown" class="user-dropdown">
        <el-dropdown-item
          :disabled="$i18n.locale === 'zh'"
          @click.native="langHandle('zh')"
        >
          中文
        </el-dropdown-item>
        <el-dropdown-item
          :disabled="$i18n.locale === 'en'"
          @click.native="langHandle('en')"
        >
          英文
        </el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>
  </div>
</template>

<script>

export default {
  name: 'Lang',
  data() {
    return {}
  },
  computed: {},
  created() {},
  methods: {
    langHandle(lang) {
      console.log(this, 8888)
      this.$i18n.locale = lang
    
    }
  }
}
</script>
<style lang="less" scoped></style>
